package com.xl.rentkeeper.util;

import com.xl.fuse.protos.AllRetCode;
import com.xl.fuse.protos.viewroom.RoomStatus;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2015/8/27.
 */
public class TipMapping {
    public static Map<Integer,String> tipsMap = new HashMap<>();
    public static Map<Integer,String> errMap = new HashMap<>();
    static {
        tipsMap.put(RoomStatus.STATUS_UN_INIT.getValue(),"未发布");
        tipsMap.put(RoomStatus.STATUS_WAIT_SELL.getValue(),"未发布");
        tipsMap.put(RoomStatus.STATUS_ON_SELL.getValue(),"销售中");
        tipsMap.put(RoomStatus.STATUS_ORDERED.getValue(),"已出租");
        tipsMap.put(RoomStatus.STATUS_RENTALED.getValue(),"已出租");
        tipsMap.put(RoomStatus.STATUS_WAIT_AUDIT.getValue(),"已出租");

        errMap.put(AllRetCode.CODE_REQUEST_TIMEOUT,"请求超时");
        errMap.put(AllRetCode.CODE_SERVER_ERR,"服务器异常");
        errMap.put(AllRetCode.CODE_PB_ERR,"协议错误");
        errMap.put(AllRetCode.CODE_IDCARD_USED_LOCKED,"身份证号码已经被使用");
        errMap.put(AllRetCode.CODE_ROOM_NOTFOUND_ERROR,"未找到该房源信息");
        errMap.put(AllRetCode.CODE_ROOM_RANTED_ERROR,"该房源在此租期内还存在其他租约");
        errMap.put(AllRetCode.CODE_STEWARD_NOTFOUND_ERROR,"没找到该管家信息");
        errMap.put(AllRetCode.CODE_STEWARD_ROOM_ERROR,"管家信息与房源信息不匹配");
        errMap.put(AllRetCode.CODE_LEASE_TIME_ERROR,"合同租期结束日期必须大于开始日期");
    }
    public static String getRoomStatus(Integer status){
        if (status == null)
            return "未知";
        return tipsMap.get(status);
    }
}
